package com.guducat.collegeWeb.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.time.ZonedDateTime;

/**
 * 文章详情数据传输对象
 * 用于向前端返回文章详细信息
 */
public class ArticleDetailDTO {
    @JsonProperty("news_id") // 强制指定JSON字段名
    private Integer newsId;

    private String category;
    private String title;

    @JsonProperty("pub_time") // 匹配数据库字段命名风格
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", timezone = "UTC")
    private ZonedDateTime pubTime;

    @JsonProperty("content_html")
    private String contentHtml;

    private String url;

    // 学院/教务处等行政机构信息
    private String section;

    // 管理员视图额外字段
    @JsonProperty("content_text")
    private String contentText;

    @JsonProperty("crawl_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", timezone = "UTC")
    private ZonedDateTime crawlTime;

    // Getters and Setters
    public Integer getNewsId() {
        return newsId;
    }

    public void setNewsId(Integer newsId) {
        this.newsId = newsId;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public ZonedDateTime getPubTime() {
        return pubTime;
    }

    public void setPubTime(ZonedDateTime pubTime) {
        this.pubTime = pubTime;
    }

    public String getContentHtml() {
        return contentHtml;
    }

    public void setContentHtml(String contentHtml) {
        this.contentHtml = contentHtml;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getContentText() {
        return contentText;
    }

    public void setContentText(String contentText) {
        this.contentText = contentText;
    }

    public ZonedDateTime getCrawlTime() {
        return crawlTime;
    }

    public void setCrawlTime(ZonedDateTime crawlTime) {
        this.crawlTime = crawlTime;
    }

    public String getSection() {
        return section;
    }

    public void setSection(String section) {
        this.section = section;
    }
}
